package commands;

/**
 * A class that implements a simple Command with a time stamp. This provides a
 * convenient base class from which other commands can be easily derived.
 */
public abstract class Command
{
	public net.StateUpdate execute() throws CommandException {
		timestamp = new java.util.Date();
		net.StateUpdate stateUpdate = new net.StateUpdate();
		return stateUpdate;
	}

	public core.Player getPlayer() {
		return player;
	}

	public void setPlayer(core.Player player) {
		this.player = player;
	}

	public java.util.Date getTimestamp() {
		return timestamp;
	}

	public String toString() {
		return getClass().toString();
	}

	/**
	 * Important: this message will be passed directly to clients, so don't put anything
	 * here that clients shouldn't see, like the name of a hidden card! You're OK if you use
	 * <core>card.getName()</code> to get that info, since the <code>Card</code> will take care
	 * of that filtering for us.
	 * @return a message representing this command
	 */
	public String getMessage() {
		return getClass().getSimpleName();
	}

	/** The player that created this Command */
	protected core.Player player = null;
	/** The time at which this Command was created */
	protected java.util.Date timestamp = null;
}